package com.yolo.aim.yoloaim.util;

import org.bytedeco.ffmpeg.avcodec.AVCodec;
import org.bytedeco.ffmpeg.global.avcodec;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.FFmpegFrameRecorder;
import org.bytedeco.javacv.Frame;

import java.io.File;


/**
 * @Author bjiang
 * @Description //TODO
 * @Date 2022/1/14 14:42
 * @Version 1.0
 *//*

public class JavaCvUtil {
    public static String convert(FFmpegFrameRecorder recorder) {

        String fileName = null;

        Frame captured_frame = null;
        try {
            fileName = "ceshi.mp4";
            //更换转码后视频存储位置
            String name = "D:\\pic\\"+fileName;
            //如果想把转码后的视频还是保存到原文件目录下
            //fileFullPathName = file.getAbsolutePath().replace(file.getAbsolutePath().substring(file.getAbsolutePath().lastIndexOf(".")), ".mp4");
            recorder.setVideoCodec(avcodec.AV_CODEC_ID_AAC);
            recorder.setFormat("mp4");
           // recorder.setFrameRate(grabber.getFrameRate());
           // recorder.setVideoBitrate(grabber.getVideoBitrate());
            recorder.setAudioBitrate(192000);
           // recorder.setAudioOptions(grabber.getAudioOptions());
            recorder.setAudioQuality(0);
            recorder.setSampleRate(44100);
            recorder.setAudioCodec(avcodec.AV_CODEC_ID_AAC);
*/
/*            recorder.start();
            recorder.stop();
            recorder.release();
            recorder.close();*//*

        } catch (Exception e) {
            e.printStackTrace();
        }
        //返回转码后视频文件名称
        return fileName;
        //返回转码后视频全路径
        //return fileFullPathName;
    }
}

*/
